package com.nuanshui.heatedloan.msgcenter.msgparams;

import com.nuanshui.heatedloan.middleware.msgcenter.bean.MsgBody;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Reference;
import com.nuanshui.heatedloan.constant.GlobalParam;
import com.nuanshui.heatedloan.fund.facade.UserBindAccountService;
import com.nuanshui.heatedloan.fund.model.UserAccount;
import com.nuanshui.heatedloan.middleware.msgcenter.annotation.MsgParams;
import com.nuanshui.heatedloan.middleware.msgcenter.bean.Model;
import com.nuanshui.heatedloan.msgcenter.constant.SmsMsgBizType;


@Component
public class UserWalletParamsParse {

	@Reference(url=GlobalParam.FUND_DUBBO_SERVER,timeout=GlobalParam.DUBBO_SERVER_TIME_OUT,version=GlobalParam.FUND_DUBBO_SERVER_VERSION)
	private UserBindAccountService userBindAccountService;
	/**
	 * 审核通过
	 * @param @param model
	 * @author guohao
	 * @date 2017年1月13日 下午4:32:02
	 * @since $
	 */
	@MsgParams(SmsMsgBizType.APPLY_DRAW_CASH_OK)
	public void userAppointmentSuccess(MsgBody model) {
		    String bizId = model.getBizId();
			UserAccount userAccount = userBindAccountService.loadPayAccountByBizId(bizId); 
			if(userAccount!=null) {
				model.putParam("payAccount", userAccount.getAccount());
				if(userAccount.getAccountType() ==1 ) {
					model.putParam("accountType", "支付宝");
				}else if(userAccount.getAccountType() == 2) {
					model.putParam("accountType", "微信");
				}
			}
			
	}
	
	
	
}
